package com.hgnu.dorm.mapper;

import com.hgnu.dorm.domain.po.Role;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface RoleMapper {

    @Insert("INSERT INTO dorm.role(role_id, role_name, role_key) VALUES (#{roleId}, #{roleName}, #{roleKey})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    void insert(Role role);

    @Update("UPDATE role SET role_id=#{roleId}, role_name=#{roleName}, role_key=#{roleKey} WHERE id=#{id}")
    void update(Role role);

    @Delete("DELETE FROM dorm.role WHERE id=#{id}")
    void deleteById(@Param("id") Long id);
}
